Wizard based DXL attribute archive/restore issue

Hello All,

When I create a wizard base DXL attribute and save it in the module. Then archive the project and restore it, The attribute stops working as module ID where the information is retrieved from is changed during restore.

for example "string limitModules[1] = {"4241c93b1c1d39d7-0000cb80"} " is the ID when I generated the attribure and does not remail valid after restore. In the past I have created a new database all together and restored from backup to make it work.

 

I was wondering what is the best way to avoid creating databases for this purpose only. and have archive / restore work in this scenario.

  1. I know one is that going into scripts and changing the IDs in the scripts. Which is labours.
  2. any others???

/////////////////////////////////////////////  Code ///////////////////////////

 

{

// Begin Script //

pragma runLim, 0

string limitModules[1] = {"4241c93b1c1d39d7-0000cb80"}

void showIn(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
   
    // Get the handle of link module from link module ID.
    Item linkModItem = itemFromID("4241c93b1c1d39d7-0000cb06")
    if (null linkModItem) {
        displayRich("\\pard " "<<Link module not found>>")
    } else if (type(linkModItem) != "Link") {
        displayRich("\\pard " "<<Invalid link module index for this database>>")
    } else { // Make sure link module is loaded
        string linkModName = fullName(linkModItem)
        for lr in all(o<-linkModName) do {
            otherMod = module (sourceVersion lr)
            if (!null otherMod) {
                if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                    if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
                    load((sourceVersion lr),false)
                }
            }
        }
        for l in all(o<-linkModName) do { // read links for linked objects
            otherVersion = sourceVersion l
            otherMod = module(otherVersion)
            if (null otherMod || isDeleted otherMod) continue
            if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue
            othero = source l
            if (null othero) {
                load(otherVersion,false)
            }
            othero = source l
            if (null othero) continue
            if (isDeleted othero) continue
            doneOne = true
            if (depth == 1) { // format string as per requirement.
               s = s "\n" "{\\b \\i" othero."Trace ID"""":}" "\n"  "{\\b Test Argument:  }" othero."Test Argument""" "\n"  "{\\b Test Description:  }"  othero."Test Description""" "\n"  "{\\b Acceptance Summary:  }" othero."Acceptance Summary""" "\n"
            }
        }
    }
    o."Verification Method / Evidence" = richText ( s)
}

//Chase in-links from objects

showIn(obj,1)

// End Script //

}


jester76 - Fri Jul 26 13:23:42 EDT 2013

Re: Wizard based DXL attribute archive/restore issue
Pekka_Makinen - Fri Jul 26 15:30:13 EDT 2013

I usually generate my traceability columns with the Analysis Wizard, but remove from the generated code to Module ID and check the modules needed either by module name or by link module name. Which will work in any database ... as long as nobody changes the module names.

Re: Wizard based DXL attribute archive/restore issue
jester76 - Fri Jul 26 15:48:39 EDT 2013

Pekka_Makinen - Fri Jul 26 15:30:13 EDT 2013

I usually generate my traceability columns with the Analysis Wizard, but remove from the generated code to Module ID and check the modules needed either by module name or by link module name. Which will work in any database ... as long as nobody changes the module names.

Thanks,

Are you able to share an example of one wizard based script modified to use module paths?

 

Thanks

Jester

Re: Wizard based DXL attribute archive/restore issue
jester76 - Fri Jul 26 16:47:01 EDT 2013

jester76 - Fri Jul 26 15:48:39 EDT 2013

Thanks,

Are you able to share an example of one wizard based script modified to use module paths?

 

Thanks

Jester

// Worked out example. Thanks

// DXL generated by DOORS traceability wizard on 26 July 2013.
// Wizard version 2.0, DOORS version 9.5.1.1
pragma runLim, 0

string limitModules[1] = {"4ea082be63e77f68-00000080"}
void showIn(Object o) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false

//     Item linkModItem = itemFromID("4ea082be63e77f68-000000e0") // this to

// this
    Item linkModItem = item ("/Training Car Project/Link Modules/Req. Links") // **************** changed path here ***************
    if (null linkModItem) {
        displayRich("\\pard " "<<Link module not found>>")
    } else if (type(linkModItem) != "Link") {
        displayRich("\\pard " "<<Invalid link module index for this database>>")
    } else {
        string linkModName = fullName(linkModItem)
        for lr in all(o<-linkModName) do {
            otherMod = module (sourceVersion lr)
            if (!null otherMod) {
                if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {

//                     if (!equal(getItem otherMod, (itemFromID limitModules[depth-1]))) continue  // this to

// this
                    if (!equal(getItem otherMod, (item("/Training Car Project/Architectural design")))) continue // **************** changed path here ***************
                    load((sourceVersion lr),false)
                }
            }
        }
        for l in all(o<-linkModName) do {
            otherVersion = sourceVersion l
            otherMod = module(otherVersion)
            if (null otherMod || isDeleted otherMod) continue
            if (!equal(getItem otherMod, (item("/Training Car Project/Architectural design")))) continue
            othero = source l
            if (null othero) {
                load(otherVersion,false)
            }
            othero = source l
            if (null othero) continue
            if (isDeleted othero) continue
            doneOne = true
                s = (identifier othero)
                if (s == "")
                displayRich("\\pard " " ")
                else
                displayRich("\\pard " s)
        }
    }
}
showIn(obj)